FROM python:3.6
LABEL maintainer=lh1993

ENV PROD_PATH /app/RedisStatusUpdate
ENV RUN_MODE run

RUN yum -y install mysql-devel net-tools make gcc gcc-c++ gcc-devel python3-devel libffi-devel libevent-devel which  &&\
    mkdir -p $PROD_PATH/tools;\
    mkdir -p $PROD_PATH/config ;\
    sed -i 's/en_US/zh_CN/' /etc/locale.conf ;\
    localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8

COPY tools $PROD_PATH/tools/
COPY requirements.txt redis_status_check.py $PROD_PATH/

RUN cd $PROD_PATH ;\
    pip3 install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple;\
    pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

WORKDIR $PROD_PATH

CMD python3 redis_status_check.py $RUN_MODE
